module Admin
  class UsersController < Admin::ApplicationController
    # To customize the behavior of this controller,
    # you can overwrite any of the RESTful actions. For example:
    #
    def index
      super
      @resources = User.page(params[:page]).per(10)
    end

    def update
      user = User.find(params[:id])
      user.update_attributes(user_params)

      redirect_to :admin_user
    end

    # Define a custom finder by overriding the `find_resource` method:
    # def find_resource(param)
    #   User.find_by!(slug: param)
    # end

    # See https://administrate-prototype.herokuapp.com/customizing_controller_actions
    # for more information

    private

    def user_params
      params[:user].permit(:name, :mobile, :role, :status, :cgj_user_id, :account_id, :director_id)
    end

  end
end
